package net.tankwar.test;

import java.util.Arrays;
import java.util.Random;

public class RandomNum {
	private int[] nums=new int[100];
	
	public RandomNum() {
		Arrays.fill(nums, 0);
	}
	
	public int ran() {
		Random ran=new Random();
		int num;
		while(true) {
			num=ran.nextInt(100);
			if(nums[num]==0) {
				nums[num]=-1;
				return num+1;
			}
		}
	}
	
	public static void main(String[] args) {
		RandomNum random=new RandomNum();
		int num;
		for(int i=0;i<50;i++) {
			num=random.ran();
			System.out.print(num+(num>9?" ":"  "));
			if((i+1) % 10==0)System.out.println();
		}
	}
}
